<template>
  <div class="shop">
     <p class="note">页面的pv/uv是指用户通过扫码进入店铺的主页或者领取页面统计的浏览和流量数据</p>

     <el-table :data="tableData" style="width:100%"  max-height="680" :cell-style="tc" :header-cell-style="tccolor">
     <el-table-column label="UID" prop="uid" ></el-table-column>
     <el-table-column label="商户名称" prop="shop_name" ></el-table-column>
     <el-table-column label="商家发券总数" prop="coupon_has_num" ></el-table-column>
     <el-table-column label="页面PV" prop="pv" ></el-table-column>
     <el-table-column label="页面UV" prop="uv" ></el-table-column>
     <el-table-column label="领券总数" prop="total_receive_union" ></el-table-column>
     <el-table-column label="用券总数" prop="total_use_union" ></el-table-column>
     <el-table-column label="操作"  width="240" >
         <template slot-scope="scope">
             <el-button size="mini" @click="lookdayData(scope.row.union_id)">每日数据</el-button>
            <el-button size="mini" type="danger" @click="deleteShop(scope.row.id)">移出分组</el-button>
         </template>
     </el-table-column>
     </el-table>
  </div>
</template>

<script>
// import {shopGroupDetail} from '@/api/goods';
  export default {
     data(){
         return{
             type_id:'',
              tableData:[],
         }
     },
     mounted(){
         console.log(this.$route.query.cid)
         this.type_id = this.$route.query.cid;
         this.getshopGroupDetailData();

     },
     methods:{
      tc() {
      return "text-align:center; color:#333333; font-size:12px;";
    },
    tccolor() {
      return "text-align:center;background-color:#f5f5f5; font-size:14px;";
    },
         async getshopGroupDetailData(){
             let res = await shopGroupDetail({id:this.type_id});
              if(res.code === 10000){
                  this.tableData = res.data;
            }
         },
         lookdayData(){

         },
         deleteShop(){
             this.$confirm('确定移出该分组','温馨提示',{
                confirmButtonText:'确定',
                cancelButtonText:'取消',
                type:'warning'
            }).then(() => {
               //删除小店
            })
         }

     }
  }
</script>

<style lang="scss" scoped>
   .shop{
       padding: 20px;

       .note{
           margin-bottom: 20px;
           color: #999999;
       }
   }
</style>
